<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<link type="text/css" href="/css/1pxtable.css" rel="Stylesheet" />	
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>

<script language="javascript"> 
function check(source){
	if(source.checked){
		$("#btn_continue").prop('disabled', false);
	}else{
		$("#btn_continue").prop('disabled', true);
	}	
}

$(function(){
	$("#code_product").keydown(function(e){
	    if(e.keyCode == 13){
	    	e.preventDefault();
	    	$('#qty').focus();
	    	$('#qty').select();
			$('#form_checkcode').submit();
	    }
	  });
	  
	var barcode = $("#code_product").attr("value");
	if(barcode.length < 1){
		$("#code_product").focus();
		$("#code_product").select();
	}else{
		$('#qty').focus();
		$('#qty').select();
	}
	var des = $("#description_product").attr("value");
	if(des == 'Item Description Not Available,Please Verify Product Barcode'){
		$("#description_product").val("");
		$("#code_product").val("");
		$("#code_product").focus();
		$("#code_product").select();
	}
});

function close_window() {
  if (confirm("Close Window?")) {
    close();
  }
}

</script>
</head>

<body style="font-family:Arial, Helvetica, sans-serif">
<h1>开始扫描入库</h1> <br />
<?php $dateToday = Model_DatetimeHelper::dateToday();?>

<form id="form_checkcode" name="form_checkcode" method="post" action="">

供货商：<select name="id_supplier" id="id_supplier"  data-placeholder="Select Supplier" class="chzn-select">
        <?php foreach($this->chinaSpList as $k => $v){?>
          <option value="<?php echo $v['id_supplier']?>" <?php if($this->supplier == $v['id_supplier']){ ?> selected="selected" <?php } ?>><?php echo $v['title_supplier']?></option>
        <?php }?> 
      </select>
      
供货商单号：<input type = "text" name = "supplier_order_no"  <?php if($this->supplierOrder){ ?>value = "<?php echo $this->supplierOrder ;?>" <?php }?>/><br/><br/>      

  <table width="1000" border="1" cellspacing="0" cellpadding="10">
    <tr>
      <th  scope="col">检查条码</th>
      <th scope="col">产品描述（英文）</th>
      <th scope="col">数量</th>
    </tr>
    <tr>
      <td>
        <label for="code_product"></label>
        <input name="code_product" type="text" id="code_product" value="<?php echo $this->codeProduct?>"  />
        <br />
        <br />
      </td>
      <td>
        <input name="description_product" type="text" id="description_product" value="<?php echo $this->des?>" size="60" />
      <span style="font-size:10px;">（余 56 字 ）</span>
      
      <br />
      <br />

      </td>
      
      <td><input type = 'text' name = "qty" size = "5" id = "qty"></input><br /><input type="submit" name="btn_continue" id="btn_continue" value="确认" <?php if($this->isNew){?>disabled <?php }?>/>
        <br /></td>
        
    </tr>
      <?php if($this->showFeedback && $this->isNew){?>
    <tr>
      <td colspan="3" align="center" bgcolor="#FF3333">产品描述不存在，产品条码错误或 为新产品，请务必检查条码</td>
    </tr>
    <?php }?>
      <?php if($this->showFeedback && !$this->isNew){?>
    <tr>
      <td colspan="3" align="center" bgcolor="#009900">产品条码检查完毕，此产品已经在数据库中，请点继续</td>
    </tr>
    <?php }?>
  </table> <br />
</form>
  <h1>
    今日入库单(<?php echo $dateToday?>)
 
  </h1> <br />
<table width="1000" border="1" cellspacing="0" cellpadding="10" style="font-size:13px;">
  <tr>
    <th scope="col">序号</th>
    <th scope="col">条码</th>
    <th scope="col">产品描述</th>
    <th scope="col">供货商</th>
    <th scope="col">数量</th>
    <th scope="col">收货员</th>
    <th scope="col">时间</th>
  </tr>
  <?php 
  
  $stDetail = new Model_DbTable_Roster_Stafflogindetail();
  $suppliers = new Model_DbTable_Suppliers();
  
  
  
  foreach($this->instoreList as $k => $v){?>
  <tr>
    <td><?php echo $k + 1;?></td>
    <td><?php echo $v['barcode'];?></td>
    <td><?php echo $v['title'];?></td>
    <td><?php 
    $sline = $suppliers->getSupplier($v['supplier']);
    echo $sline['title_supplier'];?></td>
    <td><?php echo $v['instore_qty'];?></td>
    <td><?php 
    $stLine = $stDetail->getDetail($v['instore_person']);
    echo ucwords($stLine['ni']);?></td>
    <td><?php 
	date_default_timezone_set("PRC");
	echo date("Y-m-d H:i:s",$v['instore_date']);?></td>
  </tr>
  <?php }?>
  
</table>
<br />
<br />
(Show After Scan)<br/>
<input type="button" name="button" id="button" value="入货完毕 关闭本页" onclick="window.close();opener.window.focus()" disabled="disabled" />
<form id="form1" name="form1" method="post" action="/order/order-wizard-inchina-scan-allocation">
  <input type="submit" name="button3" id="button3" value="入货完毕 准备发货" />
</form>
<br />
</body>
</html>
